# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=icon-naming-utils

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.8.90
pkgrel=1
pkgdesc="Maps the new names of icons for Tango to the legacy names used by the GNOME and KDE desktops. (mingw-w64)"
arch=('any')
license=('GPL')
url="http://tango.freedesktop.org/"
depends=('perl-XML-Simple')
source=(http://tango.freedesktop.org/releases/${_realname}-$pkgver.tar.gz
        remove-legacy-calc.patch)
md5sums=('2c5c7a418e5eb3268f65e21993277fba'
         'd3490e31df95ae11c96f0af2a9ef2ed0')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
  patch -Np1 -i "$srcdir/remove-legacy-calc.patch"
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  ./configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc \
    --libexecdir=${MINGW_PREFIX}/lib/icon-naming-utils \
    --localstatedir=${MINGW_PREFIX}/var
  make
}

package() {
  cd "${srcdir}/${_realname}-${pkgver}"
  make DESTDIR="$pkgdir" install
  mv "${pkgdir}${MINGW_PREFIX}/share/pkgconfig" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig"
}
